﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace GatherWebLib
{
    public class cSystemLog
    {
        public cSystemLog()
        {
        }

        ~cSystemLog()
        {
        }

        public void WriteLog(string strLog)
        {
            string FileName = cXmlSConfig.TaskPath + "Log\\" + DateTime.Now.ToString("yyyyMMdd");
          
            FileName = FileName + ".txt";


            if (!Directory.Exists(Path.GetDirectoryName(FileName)))
                Directory.CreateDirectory(Path.GetDirectoryName(FileName));

            FileStream myStream = File.Open(FileName, FileMode.Append, FileAccess.Write, FileShare.Write);
            StreamWriter sw = new StreamWriter(myStream, System.Text.Encoding.GetEncoding("gb2312"));

            sw.WriteLine(strLog);

            sw.Close();
            myStream.Close();



        }
    }
}
